package com.piano.moguyun;

import android.app.Application;

import com.lzy.okgo.OkGo;

public class MyApplication extends Application {
    private volatile static MyApplication application;

    @Override
    public void onCreate() {
        super.onCreate();
        application = this;
        //
        OkGo.getInstance().init(this);
    }
    /**
     * 获取实例
     *
     * @return MyApplication
     */
    public static MyApplication getInstance() {
        if (application == null) {
            synchronized (MyApplication.class) {
                if (application == null) {
                    application = new MyApplication();
                }
            }
        }
        return application;
    }
}
